package org.hzz.api.coupon.controller;

import io.gitee.pkmer.convention.page.PageResponse;
import io.gitee.pkmer.convention.page.query.PageQuery;
import io.gitee.pkmer.convention.result.Result;
import org.hzz.coupon.infrastructure.repository.mybatis.CouponScopeRepositoryImpl;
import org.hzz.promotions.domain.entity.CouponScopeEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import static io.gitee.pkmer.convention.result.Result.success;

/**
 * @author <a href="mailto:1193094618@qq.com">pkmer</a>
 * <br>
 * <a href = "https://gitee.com/developeros/videos-online">Code Repository</a>
 * At 2024/9/5
 */
@RestController
@RequestMapping("/test")
public class CouponScopeTestController {

    @Autowired
    private CouponScopeRepositoryImpl repository;

    @GetMapping("/dynamic/page")
    public Result<PageResponse<CouponScopeEntity>> page(
            @RequestBody
            PageQuery pageQuery){
        return success(repository.pageQueryCouponScope(pageQuery));
    }
}
